import service from '@/utils/request'

// 获取组织架构数据
export const getDepartment = () => {
  return service({
    url: '/company/department'
  })
}
// 获取部门负责人的数据
export const getManagerList = () => {
  return service({
    url: '/sys/user/simple'
  })
}
// 新增组织
export const addDepartment = data => {
  return service({
    method: 'post',
    url: '/company/department',
    data
  })
}
// 获取部门详情
export const getDepartmentDetail = id => {
  return service({
    url: `/company/department/${id}`
  })
}
// 更新部门
export const updateDepartment = data => {
  return service({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
// 删除部门
export const delDepartment = id => {
  return service({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
